set frustration to getState(oStoryteller, #passwordFrustration)
if integerp(frustration) then
set frustration to frustration + 1
setProp(the lsStateData of oStoryteller, #passwordFrustration, [frustration])
if (frustration mod 5) = 0 then
soundEffect(#bigHint)
end if
end if
end if
exit
end if
if the key = BACKSPACE then
if count(lsAttempt) then
deleteAt(lsAttempt, count(lsAttempt))
end if
end if
if alphaNum then
append(lsAttempt, the key)
else
nothing()
end if
set the castNum of sprite multiSprite to getAt(frameStack, count(lsAttempt) + 1)
updateStage()
end if
if the number of menus > 0 then
pass()
exit
end if
if the commandDown then
set foo to the key
if "01234567" contains foo then
do("set the soundLevel to " & foo)
end if
if "XxQq" contains the key then
set gDeferredTransit to "quitGame( oStoryteller )"
end if
end if
dontPassEvent()
end
on setPlayerIsUsingLaptop suggestion
global oStoryteller, oPuppeteer
set newValue to #None
if suggestion = 0 then
purgeMultiframes(#passwordEntry)
unFreezeInventory()
killVideo()
set newValue to 0
setProp(the lsStateData of oStoryteller, #passwordAttempt, [])
end if
if suggestion = #prompting then
loadMultiframes(#passwordEntry)
set newValue to #prompting
end if
if suggestion = #crashing then
set newValue to #crashing
end if
if suggestion = #crashed then
set newValue to #crashed
end if
if suggestion = #restart then
set newValue to #restart
end if
if suggestion = #off then
set newValue to #off
setProp(the lsStateData of oStoryteller, #passwordAttempt, [])
set the queuedSound of oPuppeteer to #computerOff
end if
if suggestion = #warmingUp then
set newValue to #warmingUp
soundEffect(#computerStart)
end if
if suggestion = #password then
freezeInventory()
set newValue to #password
end if
if suggestion = #startup then
purgeMultiframes(#passwordEntry)
unFreezeInventory()
set newValue to #startup
end if
if newValue <> #None then
setProp(the lsStateData of oStoryteller, #PlayerIsUsingLaptop, [newValue])
end if
end
on setPlayerIsExaminingPhone suggestion
global oStoryteller
if suggestion = 0 then
endLoop(#phoneRoxy)
endLoop(#phoneDead)
else
endLoop(#phoneRinging)
setProp(the lsStateData of oStoryteller, #ghostlyPhoneCall, [#dontRingPlease])
end if
setProp(the lsStateData of oStoryteller, #playerIsExaminingPhone, [suggestion])
end
on spawnGhostlyEvent
global oStoryteller, oPuppeteer
if getState(oStoryteller, #BarOnline) = 0 then
exit
end if
set currentLoc to getState(oStoryteller, #currentLocation)
set hauntList to getProp(the lsStateData of oStoryteller, #cameraFeedbackRemaining)
repeat with i in hauntList
if (i = #peekFakeout) or (i = #rightBehindYou) then
end if
if i = #ghostKnife then
set forbiddenLocations to [#DiningRmKitchenEntry2, #HallKitchenEntryOpen, #Ghse_D_S, #Ghse_D_W, #Ghse_E_W, #Ghse_P_KitchenDoorCU, #Ghse_P_KitchenEntry]
if (the gHotSublist of oPuppeteer <> #kitchen) and (getPos(forbiddenLocations, currentLoc) = 0) then
setState(oStoryteller, #PeekDisplay, #ghostKnife)
exit repeat
end if
end if
if i = #crazyLR then
set forbiddenLocations to [#HallLivingRmEntry, #HallNwall, #HallExit, #PorchDoorCU]
if (the gHotSublist of oPuppeteer <> #livingRm) and (the gHotSublist of oPuppeteer <> #Study) and (getPos(forbiddenLocations, currentLoc) = 0) then
setState(oStoryteller, #PeekDisplay, #crazyLR)
exit repeat
end if
end if
if i = #crazyDR then
if (the gHotSublist of oPuppeteer <> #diningRm) and (currentLoc <> #KitchenDiningRmEntry) and (the gHotSublist of oPuppeteer <> #Study) then
setState(oStoryteller, #PeekDisplay, #crazyDR)
exit repeat
end if
end if
if i = #KdKnob then
set forbiddenLocations to [#DiningRmKitchenEntry2, #HallKitchenEntryOpen, #Ghse_D_S, #Ghse_D_W, #Ghse_E_W, #Ghse_P_KitchenDoorCU, #Ghse_P_KitchenEntry]
if (the gHotSublist of oPuppeteer <> #kitchen) and (getPos(forbiddenLocations, currentLoc) = 0) then
setState(oStoryteller, #PeekDisplay, #KdKnob)
exit repeat
end if
end if
if i = #ghostlyKey then
if (the gHotSublist of oPuppeteer <> #MBR) and (currentLoc <> #UHallMasterBedrmEntry) then
setState(oStoryteller, #PeekDisplay, #ghostlyKey)
exit repeat
end if
end if
if i = #bloodBath then
if (the gHotSublist of oPuppeteer <> #Marg) and (currentLoc <> #UHallMargRoomEntry) then
setState(oStoryteller, #PeekDisplay, #bloodBath)
exit repeat
end if
end if
end repeat
end
on assertEdwinGhost
global gCPU
if inState(#hauntsRemaining, #lakeGhost2) then
if (getState(oStoryteller, #playerHasCrowbar) = 0) or (inState(#hauntsRemaining, #lakeGhost) = 0) then
if gCPU = #PC then
suspendSounds(#fadeOut)
end if
pushVideo()
wait(#videoStop)
if gCPU = #PC then
restoreSounds(#fadeIn)
end if
trimState(#hauntsRemaining, #lakeGhost2)
end if
end if
end
on setcurrentPageInBarManual suggestion
global oStoryteller, oPuppeteer, gOriginPoint
cursorOff()
set frameStack to getProp(the lsMultiframes of oPuppeteer, #BarManual)
set pageList to [0, 1, 2, 3, 4, 5]
set currentPage to getState(oStoryteller, #currentPageInBarManual)